import Taro , { Component } from '@tarojs/taro';
import { View, Text , Button} from '@tarojs/components';
import BG from '../../static/goods-detail/bg.png';
import { set as setGlobalData, get as getGlobalData } from '../../utils/globalData';
import './index.scss';
import { fullImgUrl } from '../../utils/utils';

export default class Index extends Component {

   config = {
       navigationBarTitleText: ''
  }

  state={
    setting: null,
  }

  componentWillMount () {
    this.setState({
      setting: getGlobalData('setting')
    })
  }
  componentDidMount () {}
  componentWillReceiveProps (nextProps,nextContext) {}
  componentWillUnmount () {}
  componentDidShow () {}
  componentDidHide () {}
  componentDidCatchError () {}
  componentDidNotFound () {}

  close() {
    this.props.onClose();
  }

  render() {
    const { setting } = this.state;
    return (
      <View className="container" onClick={this.close}>
        {setting && <Image mode="widthFix" src={fullImgUrl(setting.goods_tip)} className="bg" />}
      </View>
    );
  }
}
